﻿
using System;
using System.IO;
using log4net.Config;
using Topshelf;

namespace JobBatDeal
{
    class Program
    {
        static void Main(string[] args)
        {
            var fileName = $"{AppDomain.CurrentDomain.BaseDirectory}log4net.config";
            var fileInfo = new FileInfo(fileName);
            XmlConfigurator.ConfigureAndWatch(fileInfo);

            HostFactory.Run(x =>
            {
                x.UseLog4Net();

                x.Service<ServiceRunner>();

                x.RunAsLocalSystem();

                x.SetDescription("跑批Job运行");
                x.SetDisplayName("JobBatDealService");
                x.SetServiceName("JobBatDealService");

                x.EnablePauseAndContinue();
            });
        }
    }
}
